﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt;

    public class EnterpriseLinkUser_Map : ClassMapping<EnterpriseLinkUser>
    {
        public EnterpriseLinkUser_Map()
        {
            //映射ID
            Id(x => x.Id, map =>
            {
                map.Column("user_id");
                map.Length(40);
            });

            Property(x => x.IsValid, map =>
            {
                map.Column("is_valid");
            });
            Property(x => x.CreateDate, map =>
            {
                map.Column("create_date");
            });

            Property(x => x.LinkerDesktopPhone, map =>
            {
                map.Column("user_desktop_phone");
                map.Length(40);
            });
            Property(x => x.LinkerEmail, map =>
            {
                map.Column("user_email");
                map.Length(40);
            });
            Property(x => x.LinkerFax, map =>
            {
                map.Column("user_fax");
                map.Length(40);
            });
            Property(x => x.LinkerGender, map =>
            {
                map.Column("user_gender");
                map.Length(40);
            });
            Property(x => x.LinkerMobilePhone, map =>
            {
                map.Column("user_mobile_phone");
                map.Length(40);
            });
            Property(x => x.LinkerName, map =>
            {
                map.Column("user_name");
                map.Length(40);
            });
            Property(x => x.LinkerPosition, map =>
            {
                map.Column("user_position");
                map.Length(40);
            });
            Property(x => x.LinkerRemark, map =>
            {
                map.Column("user_remark");
                map.Length(400000);
            });

            //所属企业
            ManyToOne(x => x.Enterprise, map =>
            {
                map.Column("ent_id");
            });

            Table("t_enterprise_link_user");

            //不进行创建
            //SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
